module.exports = (db, DataTypes) => {
  return db.define('BrowsePrivileges', {
    dashboardView: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    dashboardEdit: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    fileShareView: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    fileShareEdit: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    workingScheduleView: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    workingScheduleEdit: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    dutyShiftView: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    inspectionListView: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    inspectionSupport: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    requestNoteView: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    approvalListView: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    equipmentControlView: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    userControlView: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    groupControlView: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    settingsView: {
      type: DataTypes.BOOLEAN,
      defaultValue: false,
    },
    createdAt: DataTypes.DATE,
    updatedAt: DataTypes.DATE,
  }, {
    associate(models) {
      // models.BrowsePrivileges.hasOne(models.User);
      models.BrowsePrivileges.belongsTo(models.Department,  { foreignKey: 'DepartmentId' });
    }
  })
};
